/*
 * JUnit Test Driver for the class Time
 * 
 */
// @author A0105514U
/** @author A0105514U */

package global;

import org.junit.Test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import global.Time;

public class TimeTestDriver {
	Time time;
	String timeString;
	
	// Regular Test case 1: testing constructor
	@Test
	public void testTime1() {
		time = new Time(2013,10,4,16,8);
		timeString = "201310041608";
		assertEquals(time.toString(),timeString);
	}
	
	// Regular Test case 2: testing constructor
	@Test
	public void testTime2() {
		time = new Time("201310041608");
		timeString = "201310041608";
		assertEquals(time.toString(),timeString);
	}
	
	// Boundary Case for Time  /* 28 Feb, 2013 */
	@Test
	public void testTask3(){
		time = new Time(2013,2,28,16,8);
		timeString = "201302281608";
		assertEquals(time.toString(),timeString);
	}
	
	// Boundary Case for Time  /* 29 Feb, 2013 */
	@Test
	public void testTask4(){
		time = new Time(2013,2,29,16,8);
		timeString = "201303011608";
		assertEquals(time.toString(),timeString);
	}
	
	// testing addDays method
	@Test
	public void testTaskt5(){
		time = new Time(2013,10,4,0,0);
		time = time.addDay(4);
		timeString = "201310080000";
		assertEquals(time.toString(),timeString);
	}
	
	// Boundary Case for Time /* 00:00, 09 Nov, 2013*/
	@Test
	public void testTaskt6(){
		time = new Time(2013,11,9,0,0);
		int day_of_week = time.getMonToSun();
		assertEquals(day_of_week,6);
	}
}